/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * TelaCozinha.java
 *
 * Created on 13/04/2010, 15:16:12
 */

package br.com.pi.SmartFast.view;

import br.com.pi.SmartFast.controler.ControleCozinha;

/**
 *
 * @author Alessandro Hoffmann
 */
public class TelaCozinha extends javax.swing.JFrame {

    ControleCozinha control = null;

    /** Creates new form TelaCozinha */
    public TelaCozinha() {
        initComponents();
        control = new ControleCozinha(list_pratos, list_sobremesas,jtree_arvore,
                this, BT_sair, JD_relatorio_pedidos,lbl_imagem);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        JD_relatorio_pedidos = new javax.swing.JDialog();
        jPanel1 = new javax.swing.JPanel();
        lbl_imagem = new javax.swing.JLabel();
        jScrollPane3 = new javax.swing.JScrollPane();
        jtree_arvore = new javax.swing.JTree();
        BT_sair = new javax.swing.JButton();
        jPanelPratos = new javax.swing.JPanel();
        jLabelPratosPalavra = new javax.swing.JLabel();
        jLabelCozinhaPalavra = new javax.swing.JLabel();
        jBPratoEntregue = new javax.swing.JButton();
        jBSobremesaEntregue = new javax.swing.JButton();
        jLabelSobremesaPalavra = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        list_pratos = new javax.swing.JList();
        jScrollPane2 = new javax.swing.JScrollPane();
        list_sobremesas = new javax.swing.JList();

        JD_relatorio_pedidos.setResizable(false);

        jPanel1.setBackground(new java.awt.Color(204, 255, 204));

        lbl_imagem.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/com/pi/SmartFast/imagens/imgCozinha.png"))); // NOI18N

        jtree_arvore.setBackground(new java.awt.Color(204, 255, 204));
        javax.swing.tree.DefaultMutableTreeNode treeNode1 = new javax.swing.tree.DefaultMutableTreeNode("root");
        jtree_arvore.setModel(new javax.swing.tree.DefaultTreeModel(treeNode1));
        jtree_arvore.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jtree_arvoreMouseClicked(evt);
            }
        });
        jScrollPane3.setViewportView(jtree_arvore);

        BT_sair.setBackground(new java.awt.Color(204, 255, 204));
        BT_sair.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/com/pi/SmartFast/imagens/imgSair.png"))); // NOI18N
        BT_sair.setBorder(null);
        BT_sair.setBorderPainted(false);
        BT_sair.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BT_sairActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 321, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 216, Short.MAX_VALUE)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                        .addComponent(lbl_imagem)
                        .addGap(93, 93, 93))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                        .addComponent(BT_sair, javax.swing.GroupLayout.PREFERRED_SIZE, 103, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(35, 35, 35))))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
                        .addGap(106, 106, 106)
                        .addComponent(lbl_imagem)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(BT_sair, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 503, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(99, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout JD_relatorio_pedidosLayout = new javax.swing.GroupLayout(JD_relatorio_pedidos.getContentPane());
        JD_relatorio_pedidos.getContentPane().setLayout(JD_relatorio_pedidosLayout);
        JD_relatorio_pedidosLayout.setHorizontalGroup(
            JD_relatorio_pedidosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(JD_relatorio_pedidosLayout.createSequentialGroup()
                .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        JD_relatorio_pedidosLayout.setVerticalGroup(
            JD_relatorio_pedidosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Tela Cozinha");
        setUndecorated(true);
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowOpened(java.awt.event.WindowEvent evt) {
                formWindowOpened(evt);
            }
        });

        jPanelPratos.setBackground(new java.awt.Color(204, 255, 204));

        jLabelPratosPalavra.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/com/pi/SmartFast/imagens/imgPratosPalavra.png"))); // NOI18N

        jLabelCozinhaPalavra.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/com/pi/SmartFast/imagens/imgCozinhaPalavra.png"))); // NOI18N

        jBPratoEntregue.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/com/pi/SmartFast/imagens/imgPratoEntregue.png"))); // NOI18N
        jBPratoEntregue.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBPratoEntregueActionPerformed(evt);
            }
        });

        jBSobremesaEntregue.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/com/pi/SmartFast/imagens/imgSobremesaEntregue.png"))); // NOI18N
        jBSobremesaEntregue.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBSobremesaEntregueActionPerformed(evt);
            }
        });

        jLabelSobremesaPalavra.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/com/pi/SmartFast/imagens/imgSobremesasPalavra.png"))); // NOI18N

        list_pratos.setBackground(new java.awt.Color(204, 255, 204));
        list_pratos.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        list_pratos.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                list_pratosMouseClicked(evt);
            }
        });
        jScrollPane1.setViewportView(list_pratos);

        list_sobremesas.setBackground(new java.awt.Color(204, 255, 204));
        list_sobremesas.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                list_sobremesasMouseClicked(evt);
            }
        });
        jScrollPane2.setViewportView(list_sobremesas);

        javax.swing.GroupLayout jPanelPratosLayout = new javax.swing.GroupLayout(jPanelPratos);
        jPanelPratos.setLayout(jPanelPratosLayout);
        jPanelPratosLayout.setHorizontalGroup(
            jPanelPratosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelPratosLayout.createSequentialGroup()
                .addGap(111, 111, 111)
                .addComponent(jBPratoEntregue, javax.swing.GroupLayout.PREFERRED_SIZE, 284, Short.MAX_VALUE)
                .addGap(262, 262, 262)
                .addComponent(jBSobremesaEntregue, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGap(206, 206, 206))
            .addGroup(jPanelPratosLayout.createSequentialGroup()
                .addGroup(jPanelPratosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelPratosLayout.createSequentialGroup()
                        .addGap(39, 39, 39)
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 430, Short.MAX_VALUE))
                    .addGroup(jPanelPratosLayout.createSequentialGroup()
                        .addGap(175, 175, 175)
                        .addComponent(jLabelPratosPalavra, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGap(126, 126, 126)))
                .addGroup(jPanelPratosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelPratosLayout.createSequentialGroup()
                        .addGap(143, 143, 143)
                        .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 484, Short.MAX_VALUE))
                    .addGroup(jPanelPratosLayout.createSequentialGroup()
                        .addGap(221, 221, 221)
                        .addComponent(jLabelSobremesaPalavra, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGap(115, 115, 115)))
                .addGap(140, 140, 140))
            .addGroup(jPanelPratosLayout.createSequentialGroup()
                .addGap(415, 415, 415)
                .addComponent(jLabelCozinhaPalavra, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGap(563, 563, 563))
        );
        jPanelPratosLayout.setVerticalGroup(
            jPanelPratosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelPratosLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabelCozinhaPalavra)
                .addGap(28, 28, 28)
                .addGroup(jPanelPratosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabelSobremesaPalavra)
                    .addComponent(jLabelPratosPalavra))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanelPratosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 472, Short.MAX_VALUE)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 472, Short.MAX_VALUE))
                .addGap(29, 29, 29)
                .addGroup(jPanelPratosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jBPratoEntregue)
                    .addComponent(jBSobremesaEntregue))
                .addGap(76, 76, 76))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanelPratos, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanelPratos, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void formWindowOpened(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowOpened

      control.aoAbrirTelaCozinha();
      
        
    }//GEN-LAST:event_formWindowOpened

    private void list_pratosMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_list_pratosMouseClicked

        control.ListaPratosAoClicar(evt.getClickCount(),1);
    }//GEN-LAST:event_list_pratosMouseClicked

    private void list_sobremesasMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_list_sobremesasMouseClicked

        control.ListaPratosAoClicar(evt.getClickCount(),2);
    }//GEN-LAST:event_list_sobremesasMouseClicked

    private void BT_sairActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BT_sairActionPerformed

        control.botaoSairTelaProdutosMesa();
       
    }//GEN-LAST:event_BT_sairActionPerformed

    private void jBPratoEntregueActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBPratoEntregueActionPerformed

        control.BotaoPratoEntregueAoClicar(1);
        
    }//GEN-LAST:event_jBPratoEntregueActionPerformed

    private void jBSobremesaEntregueActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBSobremesaEntregueActionPerformed

        control.BotaoPratoEntregueAoClicar(2);
        
    }//GEN-LAST:event_jBSobremesaEntregueActionPerformed

    private void jtree_arvoreMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jtree_arvoreMouseClicked

        control.jTreeArvoreAoClicar(evt.getClickCount());
    }//GEN-LAST:event_jtree_arvoreMouseClicked

    /**
    * @param args the command line arguments
    */
//    public static void main(String args[]) {
//        java.awt.EventQueue.invokeLater(new Runnable() {
//            public void run() {
//                new TelaCozinha().setVisible(true);
//            }
//        });
//    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton BT_sair;
    private javax.swing.JDialog JD_relatorio_pedidos;
    private javax.swing.JButton jBPratoEntregue;
    private javax.swing.JButton jBSobremesaEntregue;
    private javax.swing.JLabel jLabelCozinhaPalavra;
    private javax.swing.JLabel jLabelPratosPalavra;
    private javax.swing.JLabel jLabelSobremesaPalavra;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanelPratos;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JTree jtree_arvore;
    private javax.swing.JLabel lbl_imagem;
    private javax.swing.JList list_pratos;
    private javax.swing.JList list_sobremesas;
    // End of variables declaration//GEN-END:variables

}
